<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>水果店</title>
</head>
<body>
    <div id="app">
     <div>欢迎光临_vue开发的收银系统_水果店</div>
     <div>苹果 10￥/斤，折扣<8折></div>
     <div>请输入你要购买的斤数 <input v-model="shuliang"  type="number"></div>
    <button @click="result">结账买单~</button>
    <div>结账单：总价{{sum}}￥元 折后价：{{sum * 0.8}}￥元 省了：{{ sum - sum *0.8}}￥元</div>
    </div>

    <script src="./vue.js"></script>
    <script>
      const app = new Vue({
        el: '#app',
        data: {
            shuliang:'',
            sum:0
        },
        methods:{
            result(){
              this.sum = this.shuliang * 10
             
            }
        }
      })
    </script>
</body>
</html>